package han;

public class J12Retangel {

	public static void main(String[] args) {
		Retan ex1 = new Retan();
		Retan ex2= new Retan();
		ex1.width = 4;
		ex1.height = 40;
		ex1.color = "red";

		System.out.println(ex1.width);
		System.out.println(ex1.height);
		System.out.println(ex1.color);
		System.out.println(ex1.getArea());
		System.out.println(ex1.getPerimeter());
		ex2.width =3.5;
		ex2.height=4;
		ex2.color="orange";
		System.out.println(ex2.width);
		System.out.println(ex2.height);
		System.out.println(ex2.color);
		System.out.println(ex2.getArea());
		System.out.println(ex2
				.getPerimeter());
	}

}
	class Retan{
		double width;
		double height;
		double getArea;
		double getPerimeter;
		String color;
		
		public double getArea(){
			return getArea = width * height;
		}
		public double getPerimeter(){
			return getPerimeter = (width + height) * 2;
		}
	}
